# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
import uos, machine, time
import gc
# import webrepl

def connect_wifi():
    import network
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    if not wlan.isconnected():
        print('connecting to network...')
        wlan.connect('CMCC-14508', 'snwy14508')
        
    if wlan.isconnected():
        print('wifi connectted:', wlan.ifconfig())
    else:
        print('wifi not connectted.')
        wlan.active(False)
    
    print("Open AP...")
    ap = network.WLAN(network.AP_IF)
    print(ap.active(True))


print("boot...")
connect_wifi()

import ws_app

